export interface IndustryReportItem {
  id: string;
  title: string;
  industry: string;
  publishTime: string;
  status: string;
  author: string;
  summary: string;
  tags: string[];
  viewCount: number;
}

export interface IndustryReportAttachment {
  fileId: string;
  fileName: string;
  fileSize: number;
  fileType: string;
  url: string;
}

export interface IndustryReportDetail extends IndustryReportItem {
  content: string;
  attachments: IndustryReportAttachment[];
  references: {
    title: string;
    url: string;
    type: string;
  }[];
  updateTime: string;
}

export interface IndustryReportParams {
  page?: number;
  pageSize?: number;
  industry?: string;
  keyword?: string;
}

export interface IndustryReportData {
  id: string;
  title: string;
  industry?: string;
  content?: string;
  summary?: string;
  tags?: string[];
  attachments?: string[];
  references?: {
    title: string;
    url: string;
    type: string;
  }[];
  status?: string;
}

export interface CreateIndustryReportOpts {
  inputs: {
    userinput: string;
    [index: string]: any;
  };
  response_mode: 'streaming' | 'blocking'; // streaming 流式模式（推荐）。基于 SSE（Server-Sent Events）实现类似打字机输出方式的流式返回。 blocking 阻塞模式，等待执行完毕后返回结果。（请求若流程较长可能会被中断）。 由于 Cloudflare 限制，请求会在 100 秒超时无返回后中断。
  user: string; // 用户标识，用于定义终端用户的身份，方便检索、统计。 由开发者定义规则，需保证用户标识在应用内唯一。
}

export interface IndustryReportResponse {
  workflow_run_id: string;
  task_id: string;
  data: {
    id: string;
    workflow_id: string;
    status: string;
    outputs: {
      text: string;
    };
    error: null | string;
    elapsed_time: number;
    total_tokens: number;
    total_steps: number;
    created_at: number;
    finished_at: number;
  }
}

